package com.cslc.wechat.common.bean;

import java.util.HashSet;
import java.util.Set;

public class Clerk {
	private int clerkId;
	private String openid;
	private String tel;
	private String nickname;
	private String sex;
	private String subscribe;
	private String language;
	private String province;
	private String city;
	private String country;
	private String headimgurl;
	private String subscribe_time;
	private String remark;
	private String group_id;
	private Set<Terminal> terminals = new HashSet<Terminal>();

	@Override
	public String toString() {
		return "Clerk [clerkId=" + clerkId + ", openid=" + openid + ", sex=" + sex
				+ ", subscribe=" + subscribe + ", language=" + language
				+ ", province=" + province + ", city=" + city + ", country="
				+ country + ", headimgurl=" + headimgurl + ", subscribe_time="
				+ subscribe_time + ", remark=" + remark + ", group_id="
				+ group_id + ", tel=" + tel + ", nickname=" + nickname
				+ "]";
	}

	public int getClerkId() {
		return clerkId;
	}

	public void setClerkId(int clerkId) {
		this.clerkId = clerkId;
	}

	public String getOpenid() {
		return openid;
	}

	public void setOpenid(String openid) {
		this.openid = openid;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getSubscribe() {
		return subscribe;
	}

	public void setSubscribe(String subscribe) {
		this.subscribe = subscribe;
	}

	public String getLanguage() {
		return language;
	}

	public void setLanguage(String language) {
		this.language = language;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getHeadimgurl() {
		return headimgurl;
	}

	public void setHeadimgurl(String headimgurl) {
		this.headimgurl = headimgurl;
	}

	public String getSubscribe_time() {
		return subscribe_time;
	}

	public void setSubscribe_time(String subscribe_time) {
		this.subscribe_time = subscribe_time;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getGroup_id() {
		return group_id;
	}

	public void setGroup_id(String group_id) {
		this.group_id = group_id;
	}

	
	//由Clerk端维护关系，inverse="false"
	//增加一个终端绑定
	public void addToTerminal(Terminal terminal) {
		this.getTerminals().add(terminal);
	//	terminal.getClerks().add(this);
	}
	
	//删除一个终端绑定
	public void removeFromTerminal(Terminal terminal) {
		this.getTerminals().remove(terminal);
		//terminal.getClerks().remove(this);
	}

	public Set<Terminal> getTerminals() {
		return terminals;
	}

	public void setTerminals(Set<Terminal> terminals) {
		this.terminals = terminals;
	}
	
	/**
	//删除所有的终端绑定
	public void removeAllTerminals() {
		this.getTerminals().clear();
		if(null != terminals) {
			Iterator<Terminal> it = terminals.iterator();
			while(it.hasNext()) {
				Terminal terminal = it.next();
				terminals.remove(terminal);
			}
		}
		
	}
	
	**/
}
